/*
 * NumberButton.java
 *
 * Created on April 16, 2007, 12:44 PM
 */

import java.beans.*;
import java.io.Serializable;

/**
 * @author Tian, Juan
 */
public class NumberButton extends javax.swing.JButton implements Serializable {
    
  
    private PropertyChangeSupport propertySupport;
    
    public NumberButton() {
        propertySupport = new PropertyChangeSupport(this);
        setText(label);
    }
    
    
    public void addPropertyChangeListener(PropertyChangeListener listener) {
          if(propertySupport == null)
            setText("no support");
        if(listener == null)
            setText("no listener");
          //propertySupport.addPropertyChangeListener(listener);
    }
    
    public void removePropertyChangeListener(PropertyChangeListener listener) {

        propertySupport.removePropertyChangeListener(listener);
    }
    
    private void numberButton1ActionPerformed(java.awt.event.ActionEvent evt) {
        // TODO add your handling code here:
    }
    /**
     * Holds value of property label.
     */
    private String label = "press for service";

    /**
     * Getter for property label.
     * @return Value of property label.
     */
    public String getLabel() {
        label = getText();
        return this.label;
    }

    /**
     * Setter for property label.
     * @param label New value of property label.
     */
    public void setLabel(String label) {
        setText(label);
        this.label = label;
    }
    
}
